<?php
/*
  $Id: whats_new.php,v 1.31 2003/02/10 22:31:09 hpdl Exp $

  osCommerce, Open Source E-Commerce Solutions
  http://www.oscommerce.com

  Copyright (c) 2003 osCommerce

  Released under the GNU General Public License
*/

  $MAX_DISPLAY_TOP_VIEW_PRODUCTS = 10;
  $product_top_view_query = tep_db_query("select p.products_id, pd.products_name from " . TABLE_PRODUCTS . " p right join ". TABLE_PRODUCTS_VIEW_COUNT . " pv on p.products_id = pv.products_id, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_status = '1' and pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "' order by pv.products_count desc limit " . $MAX_DISPLAY_TOP_VIEW_PRODUCTS);
?>
<!-- whats_new //-->
          <tr>
            <td class="">
<?php
  $info_box_contents = array();
  $info_box_contents[] = array('text' => HEADING_TITLE_TOP_VIEW);

  new infoBoxHeading($info_box_contents, false, false);
  
  $info_box_contents = array();
  $info_box_contents[0] = array('text' => '<ul>');
  while ($product_top_view = tep_db_fetch_array($product_top_view_query)) {
 
    $product_top_view['products_name'] = tep_get_products_name($product_top_view['products_id']);
	
	$p_name = '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $product_top_view['products_id']) . '">' . substr($product_top_view['products_name'],0,MAX_DESCR_NAME) . '</a>';
	
    $info_box_contents[0]['text'] .= '<li>'.$p_name.'</li>';

  }
  	$info_box_contents[0]['text'] .= '</ul>';
    new infoBox($info_box_contents);
?>
            </td>
          </tr>
<!-- whats_new_eof //-->